
<!-- 精选优惠（广告）-->
<!-- 制作轮播图-->
<template>
  <el-carousel :interval="5000" arrow="always"  >
    <el-carousel-item class="el-carousel__item" v-for="item in images" :key="item" @click="doThis()" >
      <el-image :src="item.path" :fit="'contain'"></el-image>
<!--      <el-image :src="item.path" :fit="'fill'"></el-image>-->
    </el-carousel-item>
  </el-carousel>
</template>

<script>
import image1 from '../../assets/images-home/1.png'
import image2 from '../../assets/images-home/2.png'
import image3 from '../../assets/images-home/3.png'
import image4 from '../../assets/images-home/4.png'
export default {
  name: "Preferential",
  setup() {
    const link = 'https://pro.jd.com/mall/active/3ZYfZKGRAhbHzJySpRriJoGWo8v6/index.html'
    const images = [
        {
          path: image1,
        },
        {
          path: image2,
        },
        {
          path:image3,
        },
        {
          path:image4,
        }
    ]

    const doThis = () => {
      window.open(link)
    }
    return {
      link,
      images,
      doThis
    }
  }
}
</script>

<style scoped>


.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 350px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>